<?php
/*
*All rights reserved: Json.
*Links:http://www.liyaoquan.cn.
*Links:http://imarkchina.cn.
*Links:http://www.imarkchina.cn.
*/

/**
 * 博客后台公共控制器负责，业务流程判断
 * 后台所有操作都需要权限，必需继承 CommonAction 控制器
 */
Class PublicAction extends CommonAction{

	/**
	 * 边栏
	 * @return [type] [description]
	 */
	Public function tools(){
		$M = M('Rpublic')->Tools();
		$this->assign('title', $M['btitle']);
		$this->display();
	}

	/**
	 * 取日志点击娄
	 * @param  [type] $id [description]
	 * @return [type]     [description]
	 */
	Public function hits($id){
		$hits = loadfile(C('hits'));
		if (empty($hits[$id])) {
			Ec('100');
		} else {
			Ec($hits[$id]);
		}
	}

	/**
	 * 取日评论数
	 * @param  [type] $id [description]
	 * @return [type]     [description]
	 */
	Public function pinglun($id){
		$pinglun = loadfile(C('pinglun.id').$id.'.php');
		if (empty($pinglun)) {
			Ec('0');
		} else {
			Ec(count($pinglun));
		}
	}
}